<!-- 已联系的家政人员部分 -->
<template>
  <div class="contact-container">
    <!-- 导航栏 -->
    <van-nav-bar class="page-nav-bar" title="已联系家政人员">
      <van-icon slot="left" name="arrow-left" @click="$router.back()" />
    </van-nav-bar>
    <staff-info v-for="item in staffs" :key="item.id" :staffs="item" :contact="true" />
    <van-empty v-if="!$store.state.user" description="请登录后查看" @click="$router.push('/login')" />
    <van-empty v-else-if="!staffs.length" description="暂无已联系家服人员" />
  </div>
</template>

<script>
import { getStaffs } from '@/api/staff'

export default {
  name: 'Contact',
  components: {},
  props: {},
  data () {
    return {
      staffs: []
    }
  },
  computed: {},
  watch: {},
  created () {
    if (this.$store.state.user) {
      this.loadStaffs()
    }
  },
  mounted () {},
  methods: {
    async loadStaffs () {
      // const staffs = []
      // this.staff.forEach(async item => staffs.push(await getStaffs({ ...item })))
      // this.staffs = staffs
      this.staffs = await getStaffs()
    }
  }
}
</script>

<style scoped lang="less">

</style>
